home *** CD-ROM | disk | FTP | other *** search
/ Learn Microsoft Visual Basic 6.0 Now / Learn Microsoft Visual Basic 6.0 Now (Microsoft Press)(X03-58607)(1998).ISO / media / chap02 / b02d005.cc2 < prev    next >
Text File  |  1998-06-07  |  2KB  |  39 lines

  1. 0, Okay, in this demonstration I'll create 
  2. 3, a simple program named Hello World that 
  3. 5, uses a label object, a text box object, 
  4. 8, and a command button object to display 
  5. 10, the test message in the form. First I'll 
  6. 13, click the Label control in the Visual 
  7. 14, Basic toolbox and create a label object on 
  8. 17, my form. The label is used to display 
  9. 19, text when the program runs. And I'll use 
  10. 22, the Caption property of the label object 
  11. 26, to set the text to My Demonstration 
  12. 27, Program. Next, I'll use a text box object 
  13. 35, to display a text box on my form. I'll 
  14. 40, resize and position the text box object 
  15. 43, with the selection handles. And I'll set 
  16. 45, the text in the Properties window to 
  17. 47, Blank, so that I have room for Hello World 
  18. 49, when I click my command button. I'll 
  19. 51, create the command button by clicking the 
  20. 53, CommandButton control in the toolbox, and 
  21. 56, dragging to create the button. As 
  22. 58, always, I can resize the button simply and 
  23. 60, position it with the mouse. I'll go to the 
  24. 64, Caption property in the Properties 
  25. 66, window and set the caption to Click Me. Next, 
  26. 73, I'll write the program code for the 
  27. 74, Click Me button. I'll open the Code window 
  28. 78, by double-clicking the button on the 
  29. 79, form. This displays the event procedure for 
  30. 82, the Command1 object click event. To 
  31. 85, display the text, Hello World, in the text 
  32. 87, box, I'll type the program statement, 
  33. 90, Text1.Text = "Hello World". When I run the 
  34. 101, program, the user interface appears on 
  35. 103, the screen. When I click the Click Me 
  36. 109, button, the text, Hello World appears in 
  37. 112, the text box just like I specified in the 
  38. 114, Code window.
  39. 115, END